package com.my.mapper;

import com.my.entity.DegreeCount;
import com.my.entity.Student;
import com.my.entity.StudentQueryParam;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface StudentMapper {

    @Select("select count(*) from student")
    Integer total();

    /**
     * 分页查询
     *
     * @return
     */
    List<Student> select(StudentQueryParam param);

    /**
     * 删除学员
     * @param ids
     */
    void delete(Integer[] ids);

    /**
     * 添加学员
     * @param student
     */
    void insert(Student student);

    /**
     * 根据ID查询
     *
     * @param id
     * @return
     * @
     */
    Student selectById(Integer id);


    /**
     * 修改学生信息
     * @param student
     */
    void update(Student student);

    /**
     * 违规处理
     * @param id
     * @param score
     */
    void violation(Integer id, Integer score);


    /**
     * 返回学生学历信息
     * @return
     */
    List<DegreeCount> getStudentDegreeData();
}
